Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement err.WithCause(), a shorter version of proto.ErrorWithCause() #42

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

VojtechVitek
Copy link
Contributor

This is an experimental support for a shorter version of proto.ErrorWithCause(proto.ErrXXX, err)

 org, err := s.DB.Org.FindByExternalApplicationId(applicationId)
 if err != nil {
-	return "", proto.ErrorWithCause(proto.ErrOrgNotFound, err)
+	return "", proto.ErrOrgNotFound.WithCause(err)
 }

@VojtechVitek VojtechVitek changed the title Implement shorter version of proto.ErrorWithCause() Implement err.WithCasuse(), a shorter version of proto.ErrorWithCause() Sep 27, 2023
@VojtechVitek VojtechVitek changed the title Implement err.WithCasuse(), a shorter version of proto.ErrorWithCause() Implement err.WithCause(), a shorter version of proto.ErrorWithCause() Sep 27, 2023
@VojtechVitek
Copy link
Contributor Author

VojtechVitek commented Sep 27, 2023

Peter Kieltyka
second form looks better, i agree

@VojtechVitek VojtechVitek merged commit 750a2a0 into master Sep 27, 2023
1 check passed
@VojtechVitek VojtechVitek deleted the error_withcause branch September 27, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant